package com.itbaizhan.springbootdemo4.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/*注册web组件，方式一
* 1,添加注解: @WebServlet()
* 2,在启动类上添加@servletComponentScan (SpringBoot启动时扫描注册解标注的web组件)*/
//添加注解
@WebServlet("/first")
public class FirstServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("First Servlet......");
    }
}
